package com.whc.api.client;

import com.whc.api.client.fallback.GoodsClientFallback;
import com.whc.api.config.DefaultFeignConfig;
import com.whc.api.dto.GoodsCreateDto;
import com.whc.api.dto.OrderDto;
import com.whc.common.domain.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient(value = "goods-service",
        configuration = DefaultFeignConfig.class,
        fallbackFactory = GoodsClientFallback.class
)

public interface GoodsClient {
    @GetMapping("/client/goods/selectByIds")
    Result<List<GoodsCreateDto>> selectByIds(@RequestParam("ids") List<Long> ids);
    @PutMapping("/client/goods/deductGoodsByIds")
    Result deductGoodsByIds(@RequestBody OrderDto orderDto);
    @PostMapping("/client/goods/resetGoodsByIds")
    Result resetGoodsByIds(@RequestBody OrderDto orderDto);
}
